{% extends 'base.html' %}

{% block body%}
<class id="M_fontcolor">
    <div class="row">
        <center>
        <form action="/modfile/searchhandler/" method="post" class="form-search">
            <input type="text" name="M_searchname" class="span3">
            <input type="submit" value="搜  索" class="btn">
        </form>
        </center>
    </div>
        <h3>文件列表：</h3>
        <hr>
    <ul style="list-style: none">
        {% for file in files %}
            <li>
                <div class="span3">
                    文件名：{{ file.fileName }}
                </div>
                <div class="span2">
                    文件类型：{{ file.filetypes.fTypename }}
                </div>
                <div class="span2">
                    上传者：{{ file.users.staffs.name }}
                </div>
                <button name="M_preview" onclick="func({{ file.id }})" class="btn-primary">预览</button>
            </li>
            <hr>
        {% endfor %}
    </ul>
</class>
    <script>
        function func(fileid) {
            window.location.href = '/modfile/preview/'+fileid;
        }
    </script>
{% endblock %}